import Layout from '@/layout'
const saleRouter = {
  path: '/sale',
  component: Layout,
  redirect: '/sale/data',
  alwaysShow: true,
  name: 'Sale',
  meta: {
    type: 'I',
    roles: ['1410', '1420', '1430', '1440', '1450'],
    title: '销售',
    icon: 'sale'
  },
  children: [{
    path: 'saleOrder',
    component: resolve => require(['@/views/sale/order'], resolve),
    name: 'OrderData',
    meta: {
      type: 'I',
      roles: ['1410', '141010', '141020', '141030', '141040', '141050', '141060', '141070', '141080', '141090', '141092', '141094'],
      title: '销售订单'
    }
  }, {
    path: 'orderAdd',
    component: resolve => require(['@/views/sale/orderAdd'], resolve),
    hidden: true,
    name: 'OrderAdd',
    meta: {
      type: 'I',
      roles: ['141010'],
      title: '新增销售订单'
    }
  }, {
    path: 'orderModify',
    component: resolve => require(['@/views/sale/orderAdd'], resolve),
    hidden: true,
    name: 'OrderModify',
    meta: {
      type: 'I',
      roles: ['141020'],
      title: '编辑销售订单'
    }
  }, {
    path: 'orderDetail',
    component: resolve => require(['@/views/sale/orderAdd'], resolve),
    hidden: true,
    name: 'OrderDetail',
    meta: {
      type: 'I',
      roles: ['141020'],
      title: '查看销售订单'
    }
  }, {
    path: 'data',
    component: resolve => require(['@/views/sale/data'], resolve),
    name: 'SaleData',
    meta: {
      type: 'I',
      roles: ['1420', '142010', '142020', '142030', '142040', '142050', '142060', '142070', '142080', '142090', '142092', '142094'],
      title: '销售单'
    }
  }, {
    path: 'add',
    component: resolve => require(['@/views/sale/add'], resolve),
    name: 'SaleAdd',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['142010'],
      title: '新增销售单'
    }
  }, {
    path: 'modify',
    component: resolve => require(['@/views/sale/add'], resolve),
    name: 'SaleModify',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['142020'],
      title: '编辑销售单'
    }
  }, {
    path: 'detail',
    component: resolve => require(['@/views/sale/add'], resolve),
    name: 'SaleDetail',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['1420'],
      title: '查看销售单'
    }
  }, {
    path: 'returned',
    component: resolve => require(['@/views/sale/returned'], resolve),
    name: 'SaleReturned',
    meta: {
      type: 'I',
      roles: ['1430', '143010', '143020', '143030', '143040', '143050', '143060', '143070', '143080', '143090', '143092', '143094'],
      title: '销售退货'
    }
  }, {
    path: 'returnedAdd',
    component: resolve => require(['@/views/sale/returnedAdd'], resolve),
    name: 'SaleReturnedAdd',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['143010'],
      title: '新增销售退货'
    }
  }, {
    path: 'returnedModify',
    component: resolve => require(['@/views/sale/returnedAdd'], resolve),
    name: 'SaleReturnedModify',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['143020'],
      title: '编辑销售退货'
    }
  }, {
    path: 'returnedDetail',
    component: resolve => require(['@/views/sale/returnedAdd'], resolve),
    name: 'SaleReturnedDetail',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['1430'],
      title: '查看销售退货'
    }
  }, {
    path: 'delivery',
    component: resolve => require(['@/views/sale/delivery'], resolve),
    name: 'Delivery',
    meta: {
      type: 'I',
      roles: ['1440', '144010', '144020', '144030', '144040', '144050', '144060', '144070', '144080', '144090', '144092', '144094'],
      title: '销售配送'
    }
  }, {
    path: 'deliveryAdd',
    component: resolve => require(['@/views/sale/deliveryAdd'], resolve),
    name: 'DeliveryAdd',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['144010'],
      title: '新增配送单'
    }
  }, {
    path: 'deliveryModify',
    component: resolve => require(['@/views/sale/deliveryAdd'], resolve),
    name: 'DeliveryModify',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['144020'],
      title: '编辑配送单'
    }
  }, {
    path: 'deliveryDetail',
    component: resolve => require(['@/views/sale/deliveryAdd'], resolve),
    name: 'DeliveryDetail',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['144020'],
      title: '查看配送单'
    }
  }, {
    path: 'invoice',
    component: resolve => require(['@/views/sale/invoice'], resolve),
    name: 'SaleInvoice',
    meta: {
      type: 'I',
      roles: ['1450', '145010', '145020', '145030', '145040', '145050', '145060', '145070', '145080', '145090', '145092', '145094'],
      title: '销售发票'
    }
  }, {
    path: 'invoiceAdd',
    component: resolve => require(['@/views/sale/invoiceAdd'], resolve),
    name: 'InvoiceAdd',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['145010'],
      title: '新增销售发票'
    }
  }, {
    path: 'invoiceModify',
    component: resolve => require(['@/views/sale/invoiceAdd'], resolve),
    name: 'InvoiceAdd',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['145020'],
      title: '编辑销售发票'
    }
  }, {
    path: 'invoiceDetail',
    component: resolve => require(['@/views/sale/invoiceAdd'], resolve),
    name: 'InvoiceAdd',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['145020'],
      title: '查看销售发票'
    }
  }, {
    path: 'everyday',
    component: resolve => require(['@/views/sale/everyday'], resolve),
    name: 'EverydayData',
    meta: {
      type: 'I',
      roles: ['1460', '146010', '146020', '146030', '146040', '146050', '146060', '146070', '146080', '146090', '146092', '146094'],
      title: '销售日结'
    }
  }, {
    path: 'everydayAdd',
    component: resolve => require(['@/views/sale/everydayAdd'], resolve),
    name: 'EverydayAdd',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['146010'],
      title: '新增销售日结'
    }
  }, {
    path: 'everydayModify',
    component: resolve => require(['@/views/sale/everydayAdd'], resolve),
    name: 'EverydayAdd',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['146020'],
      title: '编辑销售日结'
    }
  }, {
    path: 'everydayDetail',
    component: resolve => require(['@/views/sale/everydayAdd'], resolve),
    name: 'EverydayAdd',
    hidden: true,
    meta: {
      type: 'I',
      roles: ['146020'],
      title: '查看销售日结'
    }
  }]
}

export default saleRouter
